s = input("введите ")
s1, s2, s3, s4, s5, s6 , s7, s8 = "", "", "", "", "", "", "", ""
for c in s:
    if c == '(':
        s1 += c
    if c == ')' and len(s3) == 0 and len(s5) == 0 and len(s7) == 0:
        s2 += c
        if len(s1) > 0:
            if s1[-1] == '(':
                s1 = s1[:-1]
                s2 = s2[:-1]
    if c == '[':
        s3 += c
    if c == ']' and len(s5) == 0 and len(s7) == 0:
        s4 += c
        if len(s3) > 0:
            if s3[-1] == '[':
                s3 = s3[:-1]
                s4 = s4[:-1]
    if c == '{':
        s5 += c
    if c == '}':
        s6 += c
        if len(s5) > 0:
            if s5[-1] == '{':
                s5 = s5[:-1]
                s6 = s6[:-1]

    if c == '<':
      s7 += c
    if c == '>':
      s8 += c
      if len(s7) > 0:
          if s7[-1] == '<':
              s7 = s7[:-1]
              s8 = s8[:-1]
                
if len(s1) == 0 and len(s2) == 0 and len(s3) == 0 and len(s4) == 0 and len(s5) == 0 and len(s6) == 0 and len(s7) == 0 and len(s8) == 0:
    print("Верная")
else:
    print("Неверная")

